<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>验证邮箱</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
  </style>
</head>

<body>

  <!-- <p>
    <label for="">邮箱：</label>
    <input type="email" placeholder="请输入邮箱">
  </p> -->
  <script>
    // 需求： 邮箱以 @  163.com 126.com qq.com .net .cn .sign结尾
    let reg = /^[0-9A-Za-z]{5,12}@(163\.com|126\.com|qq\.com|\.net|\.cn|\.sign)$/
    let str = "123456@163.com"
    let str1 = "123456@126.com"
    let str2 = "123456@qq.com"
    let str3 = "xiaoxiao@126.com"
    console.log(reg.test(str3));

    // let reg1 = /^[0-9A-Za-z]{5,12}[@](163\.com){1}$/
    // let str1 = "123456@163.com"
    // console.log(reg1.test(str1));
  </script>
</body>

</html>